var urls = require("./urls.js");
var url = {
  //电影
  movie_data: function(obj) {
    wx.request({
      url: urls.movie_url + "?count=" + obj.count,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电视剧
  tv_data: function(obj) {
    wx.request({
      url: urls.tv_url + "?count=" + obj.count,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //综艺
  show_data: function(obj) {
    wx.request({
      url: urls.show_url + "?count=" + obj.count,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电影详情
  details_movie: function(obj) {
    wx.request({
      url: urls.movieDetail + obj.id,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电视剧和综艺
  details_tv: function(obj) {
    wx.request({
      url: urls.tvDetail + obj.id,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //游戏详情
  details_game: function(obj) {
    wx.request({
      url: urls.gameDetail + obj.id,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //书详情
  details_book: function(obj) {
    wx.request({
      url: urls.bookDetail + obj.id,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电影标签
  tags_movie: function(obj) {
    wx.request({
      url: urls.movieDetail + obj.id + "/tags?count=8",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电视剧和综艺标签
  tags_tv: function(obj) {
    wx.request({
      url: urls.tvDetail + obj.id + "/tags?count=8",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //游戏标签
  tags_game: function(obj) {
    wx.request({
      url: urls.gameDetail + obj.id + "/tags?count=8",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //书标签
  tags_book: function(obj) {
    wx.request({
      url: urls.bookDetail + obj.id + "/tags?count=8",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电影评论
  interests_movie: function(obj) {
    wx.request({
      url: urls.movieDetail + obj.id + "/interests?count=" + obj.count + "&start=" + obj.start,
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //电视剧和综艺评论
  interests_tv: function(obj) {
    wx.request({
      url: urls.tvDetail + obj.id + "/interests",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //游戏评论
  interests_game: function(obj) {
    wx.request({
      url: urls.gameDetail + obj.id + "/interests",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //书评论
  interests_book: function(obj) {
    wx.request({
      url: urls.bookDetail + obj.id + "/interests",
      success: function(res) {
        obj.success(res)
      }
    })
  },
  //搜索
  search_data: function(obj) {
    wx.request({
      url: urls.searchUrl + "?q=" + obj.q,
      success: function(res) {
        obj.success(res)
      }
    })
  }

}
module.exports = url